import { COMMON_WIDTH, COMMON_HEIGHT  } from '@/common/const-dif'
import { CANVAS_MC_TYPES, BITMAP_TEXT_ITEM_TYPES, THREE_LOAD_TYPES, RESIZE_TYPE } from '@/common/const-canvas'
import { PAPER_TYPE_MAP } from '@/common/const-wb'

export const DefaultStylesCanvas = {
  304: {
    backgroundColor: "rgba(240, 248, 255, 1)",
    transform:'rotate(0deg)',
    opacity: 1,
  },
  306: {
    backgroundColor: "rgba(240, 248, 255, 1)",
    transform:'rotate(0deg)',
    opacity: 1,
  },
  1000: {
  },
  5001: {
  },
  5002: {
  },
}

export const ComponentTypesCanvas =  {
  304: {
    id: -1,
    cid: 304,
    type: "wb-bitmap-text",
    name: "WbBitmapText",
    title: '位图文本',
    tabName: 'img',
    conAttr: { width:(COMMON_WIDTH-100)/2, height:COMMON_HEIGHT/10, top:0, left:0 },
    commonAttr: { 
      rotate: 0, opacity: 1, isFullScreen: false, resizeType: RESIZE_TYPE[0].value,
      url:'https://static.hd.xxx.com/upload/biz/14/320288.png', isCreatejs: true,
      text: 'Hello world!', frames: '', animations: '', processes: '', itemType: BITMAP_TEXT_ITEM_TYPES[0].value,
    },
  },
  306: {
    id: -1,
    cid: 306,
    type: "wb-mc",
    name: "WbMc",
    title: '动画',
    tabName: 'mc',
    conAttr: { width:COMMON_WIDTH/2, height:COMMON_HEIGHT/4, top:0, left:0 },
    commonAttr: { 
      itemType: CANVAS_MC_TYPES[0].value, customClassName: '', injectJsClassParams: '', defaultPicUrl: '',  
      isFullScreen: false, resizeType: RESIZE_TYPE[0].value, designWidth: 750, designHeight: 1334, 
      isCustomFont: false, isCreatejs: false, loadJsUrl: ''
    },
  },
  400: {
    id: -1,
    cid: 400,
    type: "wb-paper",
    name: "WbPaper",
    title: '矢量画板',
    tabName: 'paper',
    conAttr: { width:COMMON_WIDTH/2, height:COMMON_HEIGHT/2, top:0, left:0 },
    commonAttr: { 
      rotate: 0, opacity: 1, isFullScreen: false, designWidth: 750, designHeight: 1334, 
      itemType: PAPER_TYPE_MAP.freedomDraw, params: '{"strokeColor":"black","simplifySegment":10,"fillColor":"black"}'
    },
  },
  1000: {
    id: -1,
    cid: 1000,
    type: "wb-phasers",
    name: "WbPhasers",
    title: '游戏',
    tabName: 'phaser',
    conAttr: { width:COMMON_WIDTH/2, height:COMMON_HEIGHT/2, top:0, left:0 },
    commonAttr: { 
      isVisible: true, isFullScreen: false, resizeType: RESIZE_TYPE[0].value,
      designWidth: COMMON_WIDTH, designHeight: COMMON_HEIGHT, injectJsClass: '', injectJsClassParams: '',
    },
  },
  2004: {
    id: -1,
    cid: 2004,
    type: "wb-pixis",
    name: "WbPixis",
    title: '交互动画',
    tabName: 'pixis',
    conAttr: { width:COMMON_WIDTH/2, height:COMMON_HEIGHT/2, top:0, left:0 },
    commonAttr: {
      isVisible: true, isFullScreen: false, resizeType: RESIZE_TYPE[0].value,
      designWidth: COMMON_WIDTH, designHeight: COMMON_HEIGHT, injectJsClass: '', injectJsClassParams: '',
    },
  },
  5001: {
    id: -1,
    cid: 5001,
    type: "wb-panorama",
    name: "WbPanorama",
    title: '全景图',
    tabName: 'panorama',
    conAttr: { width:COMMON_WIDTH/2, height:COMMON_HEIGHT/2, top:0, left:0 },
    commonAttr: {
      isFullScreen: true, resizeType: RESIZE_TYPE[0].value,
      scene: { backgroundColor: "transparant", },
      camera: { fov: 75, near: 1, far: 1000, position: "0,0,0" },
      light: {
        hemi: { skyColor: "#ddeeff", groundColor: "#0f0e0d", intensity: 5 },
        directional: {color: "#ffffff", intensity: 0.5 },
        position: "0, 0, 0"
      },
      itemType: THREE_LOAD_TYPES[0].value, url: 'https://static.hd.xxx.com/upload/biz/1/203116.jpg', data:''
    },
  },
  5002: {
    id: -1,
    cid: 5002,
    type: "wb-threes",
    name: "WbThrees",
    title: '3d',
    tabName: 'threes',
    conAttr: { width:COMMON_WIDTH/2, height:COMMON_HEIGHT/2, top:0, left:0 },
    commonAttr: {
      isFullScreen: false, resizeType: RESIZE_TYPE[0].value,
      designWidth: COMMON_WIDTH/2, designHeight: COMMON_HEIGHT/2, injectJsClass: '', injectJsClassParams: '',
      camera: { fov: 75, near: 0.1, far: 1000, position: "0,0,0" },
      render: {}
    },
  },
}
